#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main()
{
	int l, ret = 0, digit = 0;
	scanf("%d", &l);
	for (int i = 2; ret <= l; i++) {
		for (int j = 2; j * j <= i; j++) 
			if (i % j == 0)goto end;
		ret += i;
		if (ret > l)break;
		printf("%d\n", i);
		digit++;
	end:;
	}
	printf("%d", digit);
	return 0;
}